<?php $this->load->view('common/ck-bosspagehead'); ?>
<?php $this->load->view('common/ck-bossheader'); ?>
<article id="content">
    <div class="pgwrapper">
    <div class="w960 bg1 p15 bx_shw">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td width="20%" style="border-right: 2px solid #e5e5e5;" valign="top">
		<?php $this->load->view('enterprises/leftnavCMS'); ?>
		</td>
		<td width="80%"><form enctype="multipart/form-data"
				action="/addCoupon"  onsubmit="return validateForm()" method="POST">
				<table width="100%" border="0" cellpadding="5" cellspacing="0"
					style="padding-left: 20px;">
					<tr>
						<td class="txt-blck">Select Store:</td>
						 <td><select id="code_store[]" name="code_store[]" multiple="multiple" style="width: 200px;" onChange="storeredirectCheck()">
			                	<?php foreach ($allStoresArray as $temp){ ?>
								<option value="<?php echo $temp['store_id']; ?>">
								<?php echo $temp['store_name']; ?>
								</option>
								<?php } ?>		                	
			            	</select></td>
					</tr>
					<tr>
						<td class="txt-blck" width="30%">Deal Title:</td>
						<td width="70%"><input type="text" value="" name="coupon_name"
							id="coupon_name" class="inputCMS"   />
						</td>
					</tr>
					<tr>
						<td class="txt-blck" width="30%">Deal Code	:</td>
						<td width="70%"><input type="text" value="" name="coupon_code"
							id="coupon_code" class="inputCMS"   />
						</td>
					</tr>
                    <tr>
						<td class="txt-blck" width="30%">Deal Saving	:</td>
						<td width="70%"><input type="text" value="" name="coupon_saving"
							id="coupon_saving" class="inputCMS"   />
						</td>
					</tr>
                    <tr>
						<td class="txt-blck" width="30%">Deal Price	:</td>
						<td width="70%"><input type="text" value="" name="coupon_price"
							id="coupon_price" class="inputCMS"   />
						</td>
					</tr>
					</tr>
					<tr>
						<td class="txt-blck">Deal Status:</td>
						<td><select id="coupon_status" name="coupon_status">
								<option value="Yes">Yes</option>
								<option value="No">No</option>
						</select></td>
					</tr>
					<tr>
						<td class="txt-blck">Deal Type:</td>
						<td><select id="coupon_type" name="coupon_type">
                                <option value="Deal">Deal</option>
								<option value="Top">Top Deal</option>
								<option value="Featured">Featured Deal</option>
						</select></td>
					</tr>
					<tr>
						<td class="txt-blck">Deal Category:</td>
						<td><select id="coupon_cat" name="coupon_cat">
                                <option value="0">None</option>
                                <?php foreach($allCategoriesArray as $temp){ ?>
								<option value="<?php echo $temp['category_id']; ?>"><?php echo $temp['category_name']; ?></option>
                                <?php } ?>
						</select></td>
					</tr>
					
					<tr>
						<td valign="top" class="txt-blck">Deal Description:</td>
						<td><textarea style="width: 450px; height: 300px;" class="inputCMS"
								id="coupon_description" name="coupon_description"></textarea></td>
					</tr>
					<tr id="imgLarge">
						
					</tr>
					<tr>
						<td valign="top" class="txt-blck" id="affurl_title">Deal Affliate URL:</td>
						<td>
							<div id="check_deep">
								<input type="checkbox" name="editURL" id="editURL" value="1"
									onclick="activeCAU();selectTrack();" /> Deep Link URL
							</div>
							
						<!-- 	<div id="radioDiv" style="display:none;">
								<input type="radio" name="omg" id="omg" onclick="insertTrack(1)" /> OMG
								<input type="radio" name="tc" id="tc" onclick="insertTrack(2)" /> Trootrac
								<input type="radio" name="ty" id="ty" onclick="insertTrack(3)" /> Tyroo
							</div> -->
							
							<div id="affliateURLDiv">
                                
                                <input type="text" name="coupon_affilateurl" id="coupon_affilateurl" style="width: 320px" value=""	readonly />
							</div>
							
							<div id="utmsrc" style="display:none;">
								<input type="text" name="utmSource" id="utmSource" style="width: 400px"  value=""
								onblur="if(this.value=='') this.value='Enter UTM Source Code Here..';" onfocus="if(this.value=='Enter UTM Source Code Here..')this.value='';" value="Enter UTM Source Code Here.." />
							</div>
							
						</td>
					</tr>
					<tr>
						<td valign="top" class="txt-blck">Deal Start Date:</td>
						<td><input type="text" name="coupon_startdate" id="coupon_startdate" style="width: 100px"
							onfocus="javascript:NewCssCal('coupon_startdate','yyyymmdd','arrow',false,'24',false);"
							value=""
							readonly /> (yyyy/mm/dd)</td>
					</tr>
					<tr>
						<td valign="top" class="txt-blck">Deal Expire Date:</td>
						<td><input type="text" name="coupon_expiredate" id="coupon_expiredate" style="width: 100px"
							onfocus="javascript:NewCssCal('coupon_expiredate','yyyymmdd','arrow',false,'24',false);"
							value=""
							readonly /> (yyyy/mm/dd)</td>
					</tr>
					<tr>
						<td></td>
						<td><input type="submit" name="code_submit" value="Submit" /></td>
					</tr>
				</table>
			</form></td>
	</tr>
</table>
</div>
</div>
</article>
<div class="clr-both spacer-10">&nbsp;</div>
<?php $this->load->view('common/ck-bossfooter'); ?>
<script>

function validateForm(){
	var x = document.getElementById('coupon_name').value;
	if(x==""){
	alert("Coupon Title must be filled out.");
	return false;
	}
}
	
</script>

	